let firstY
function touchStartHandler(e){
	console.log('触摸')
	firstY = e.targetTouches[0].clientY
}
function touchMoveHandler(e){
	let target = e.currentTarget
	let offsetHeight = target.offsetHeight, scrollHeight = target.scrollHeight
	let changedTouches = e.changedTouches
	let scrollTop = target.scrollTop
	if (changedTouches.length > 0) {
	  let touch = changedTouches[0] || {}
	  let moveY = touch.clientY
	  if (moveY > firstY && scrollTop === 0) {
	    // 滑动到弹窗顶部临界条件
	    e.preventDefault()
	    return false
	  } else if (moveY < firstY && scrollTop + offsetHeight >= scrollHeight) {
	    // 滑动到底部临界条件
	    e.preventDefault()
	    return false
	  }
	}
}
export default{
	bind(el,binding){
		el.addEventListener('touchstart', touchStartHandler, false)
		el.addEventListener('touchmove', touchMoveHandler, false)
	},
	update(el, binding) {
	  el.removeEventListener('touchstart', touchStartHandler, false)
		el.removeEventListener('touchmove', touchMoveHandler, false)
		el.addEventListener('touchstart', touchStartHandler, false)
		el.addEventListener('touchmove', touchMoveHandler, false)
	},
	unbind(el) {
	  el.removeEventListener('touchstart', touchStartHandler, false)
	  el.removeEventListener('touchmove', touchMoveHandler, false)
	}
}